package com.czkevin.cif.events;

import com.czkevin.cif.crafting.RecipeMatch;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

public class CIFCraftingMatchEvent extends Event implements Cancellable {

  private final static HandlerList handlerList = new HandlerList();

  private final HumanEntity player;

  private RecipeMatch matchedRecipe;

  private boolean cancelled;

  private int requiredClicks = 0;


  public CIFCraftingMatchEvent(HumanEntity player, RecipeMatch matchedRecipe) {
    this.player = player;
    this.matchedRecipe = matchedRecipe;
  }

  public CIFCraftingMatchEvent(HumanEntity player, RecipeMatch matchedRecipe, int requiredClicks) {
    this.player = player;
    this.matchedRecipe = matchedRecipe;
    this.requiredClicks = requiredClicks;
  }

  public HumanEntity getPlayer() {
    return player;
  }

  public RecipeMatch getMatchedRecipe() {
    return matchedRecipe;
  }

  public void setMatchedRecipe(RecipeMatch matchedRecipe) {
    this.matchedRecipe = matchedRecipe;
  }

  public int getRequiredClicks() {
    return requiredClicks;
  }

  public void setRequiredClicks(int requiredClicks) {
    this.requiredClicks = requiredClicks;
  }

  @Override
  public boolean isCancelled() {
    return cancelled;
  }

  @Override
  public void setCancelled(boolean cancelled) {
    this.cancelled = cancelled;
  }

  @Override
  public HandlerList getHandlers() {
    return handlerList;
  }

  public static HandlerList getHandlerList() {
    return handlerList;
  }
}
